public class Solution65 {
    public boolean isNumber(String s) {
        if (s.equals("Infinity") || s.equals("-Infinity") || s.equals("+Infinity"))
            return false;
        char c = s.charAt(s.length() - 1);
        if (c == 'f' || c == 'D')
            return false;
        try {
            double a = Double.parseDouble(s);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}
